{extend name="base" /}

{block name="title"}首页{/block}

{block name="main"}
<div class="main">
	<div class="ljdh_box">
		<div class="container ljBar">
			<ul class="breadcrumb">
			  <li><a href="/">王者荣耀</a></li>
			  <li class="active">签到</li>
			</ul>
			<div class="qdtj">
				<div><a href="/pettyCashLog"><span>备用金：</span><span>{$totalPettyCash}</span></a></div>
				<div><span>今日签到之星：</span><span>{$userSignStarUsername??'无'}</span></div>
				<div><span>历史最高人数：</span><span>{$Think.session.user_id??'100'}人</span></div> 
				<!--<div class="qdgz"><a href="#">奖励规则</a></div>-->
			</div>
			
		</div>
	</div>
	<div class="qd_col">
		<div class="container">
			<div class="qd_b_box clearfix">
				<div class="user_box">
					<p class="img_box"></p>
					{gt name="Think.session.user_id" value="0"}
					<p>{$Think.session.user_name}</p>
					{else/}
					<p><a href="#ale_login" class="ale_btn" >请登陆</a></p>
					{/gt}
				</div>
				<div class="qd_data">
					<div class="data_box clearfix">
						<div class="qd_data_list">
							<p>{$userSign.continuity_total_day ?? 0}<sub>天</sub></p>
							<p class="data_title">连续签到</p>
						</div>
						<div class="qd_data_list">
							<p><sub>Lv.</sub>{$userSign? $userSign -> getData('level') : 0}</p>
							<p class="data_title">签到等级</p>
						</div>
						<div class="qd_data_list">
							<p>{$userSign.total_points ?? 0}<sub>分</sub></p>
							<p class="data_title">积分奖励</p></div>
						<div class="qd_data_list">
							<p>{$userSign.total_day ?? 0}<sub>天</sub></p>
							<p class="data_title">总天数</p>
						</div>
					</div>
				</div>
				<div class="user_qd">
					{gt name="Think.session.user_id" value="0"}
					{$userSign.is_sign? '<div class="qd_btn" style="background-image: url(/images/sign_up.png);"><a href="javascript:void(0);"></a></div>' : '<div class="qd_btn"><a href="javascript:userSign();"></a></div>'}
					{else/}
					<div class="qd_btn"><a href="#ale_login" class="ale_btn"></a></div>
					{/gt}
				</div>
			</div>
		</div>
	</div>
	<div class="qdph">
		<div class="qdph_header">
			<div class="container">
				<ul class="clearfix tab_title_box">
					<li class="active">今日排行</li>
					<li>本月排行</li>
					<li>总排行</li>
					<li>奖金排行</li>
				</ul>
			</div>
		</div>
		<div class="container">
			<div class="qdph_body">
				<div class="qdph_A block">
					<div class="table-responsive">
					  	<table class="table">
					    	<tr>
					    		<td>昵称</td>
					    		<td>总天数</td>
					    		<td>月天数</td>
					    		<td>上次签到时间</td>
					    		<td>目前等级</td>
					    		<td>上次奖励</td>
					    	</tr>
					    	{volist name='cTotalDays' id='val'}
					    	<tr>
					    		<td>{$val.username}</td>
					    		<td>{$val.total_day}</td>
					    		<td>{$val.month_total_day}</td>
					    		<td>{$val.last_time|date="Y-m-d",###}</td>
					    		<td>{$val.level}</td>
					    		<td>{$val.last_points}金钱</td>
					    	</tr>
							{/volist}
					  	</table>
					</div>
					<div class="fy_box">
						<!--<nav>
						  <ul class="pager">
						    <li><a href="#">上一页</a></li>
						    <li><a href="#">下一页</a></li>
						  </ul>
						</nav>-->
					</div>
				</div>
				<div class="qdph_B">
					<div class="table-responsive">
					  	<table class="table">
					    	<tr>
					    		<td>昵称</td>
					    		<td>总天数</td>
					    		<td>月天数</td>
					    		<td>上次签到时间</td>
					    		<td>目前等级</td>
					    		<td>上次奖励</td>
					    	</tr>
					    	{volist name='mTotalDays' id='val'}
					    	<tr>
					    		<td>{$val.username}</td>
					    		<td>{$val.total_day}</td>
					    		<td>{$val.month_total_day}</td>
					    		<td>{$val.last_time|date="Y-m-d",###}</td>
					    		<td>{$val.level}</td>
					    		<td>{$val.last_points}金钱</td>
					    	</tr>
							{/volist}
					  	</table>
					</div>
					<!--<div class="fy_box">
						<nav aria-label="...">
						  <ul class="pager">
						    <li><a href="#">上一页</a></li>
						    <li><a href="#">下一页</a></li>
						  </ul>
						</nav>
					</div>-->
				</div>
				<div class="qdph_C">
					<div class="table-responsive">
					  	<table class="table">
					    	<tr>
					    		<td>昵称</td>
					    		<td>总天数</td>
					    		<td>月天数</td>
					    		<td>上次签到时间</td>
					    		<td>目前等级</td>
					    		<td>上次奖励</td>
					    	</tr>
					    	{volist name='totalDays' id='val'}
					    	<tr>
					    		<td>{$val.username}</td>
					    		<td>{$val.total_day}</td>
					    		<td>{$val.month_total_day}</td>
					    		<td>{$val.last_time|date="Y-m-d",###}</td>
					    		<td>{$val.level}</td>
					    		<td>{$val.last_points}金钱</td>
					    	</tr>
							{/volist}
					  	</table>
					</div>
					<div class="fy_box">
						<!--<nav aria-label="...">
						  <ul class="pager">
						    <li><a href="#">上一页</a></li>
						    <li><a href="#">下一页</a></li>
						  </ul>
						</nav>-->
					</div>
				</div>
				<div class="qdph_D">
					<div class="table-responsive">
					  	<table class="table">
					    	<tr>
					    		<td>昵称</td>
					    		<td>总天数</td>
					    		<td>月天数</td>
					    		<td>上次签到时间</td>
					    		<td>目前等级</td>
					    		<td>总奖励</td>
					    	</tr>
					    	{volist name='totalPoints' id='val'}
					    	<tr>
					    		<td>{$val.username}</td>
					    		<td>{$val.total_day}</td>
					    		<td>{$val.month_total_day}</td>
					    		<td>{$val.last_time|date="Y-m-d",###}</td>
					    		<td>{$val.level}</td>
					    		<td>{$val.total_points}金钱</td>
					    	</tr>
							{/volist}
					  	</table>
					</div>
					<div class="fy_box">
						<!--<nav>
						  <ul class="pager">
						    <li><a href="#">上一页</a></li>
						    <li><a href="#">下一页</a></li>
						  </ul>
						</nav>-->
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div class="zjjl">
		<div class="container">
			<div class="zjjl_title">
				中奖用户
			</div>
			<div class="zjgg">
				<div class="zjgg_title">获奖记录</div>
				<div class="zjgg_main">
					<ul class="zjgg_gruop">
						{volist name='cTotalDays' id='val'}
						<li class="clearfix">
							<p class="pull-left">{$val.username}</p>
							<p class="pull-right">获得了{$val.last_points}金钱</p>
						</li>
						{/volist}
					</ul>
					<script type="text/javascript">
						scrollUp();
					</script>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	function userSign() {
		$.post('/user/sign', {},function(result) {
			if(result.code != 0) {
				alert(result.message);
			} else {
				window.location.reload();
			}
		}, 'json');
	}
</script>
{/block}